package com.sky.mapper;

import com.github.pagehelper.Page;
import com.sky.dto.GoodsSalesDTO;
import com.sky.dto.OrdersPageQueryDTO;
import com.sky.entity.Orders;
import org.apache.ibatis.annotations.Mapper;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

/**
 * @author wangqi
 * @date 2024/1/4 11:19
 */
@Mapper
public interface OrdersMapper {
    void insert(Orders orders);

    Page<Orders> findOrdersByUserId(Long userId,Integer status);

    Orders findOrdersById(Long id);

    void cancel(Long id);

    Page<Orders> findOrdersByCondition(OrdersPageQueryDTO ordersPageQueryDTO);

    Integer countStatus(Integer status);

    void updateCancel(Orders orders);

    void update(Orders orders);


    Double turnoverByMap(Map map);

    Integer countByMap(Map map);

    List<GoodsSalesDTO> getSalesTop10(LocalDateTime beginTime, LocalDateTime endTime);
}
